<template>
  <div class="interview">
    <div class="header">
      <div class="left">
        <!-- <div class="txt">推荐</div>
        <div class="txt">最新</div> -->
        <div class="item" @click="qiehuan(1)">
          <router-link to="/home/interview/recommon"> 推荐 </router-link>
          <div class="hx" v-if="xh"></div>
        </div>
        &nbsp;&nbsp;
        <div class="item" @click="xh = 0">
          <router-link to="/home/interview/new"> 最新 </router-link>
          <div class="hx" v-if="!xh"></div>
        </div>
      </div>
      <div class="right"></div>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      xh: 1,
    };
  },
  methods: {
    qiehuan(xh) {
      this.xh = xh;
    },
  },
};
</script>

<style lang="less" scoped>
.interview {
  padding: 10px;
  .header {
    display: flex;
    margin-bottom: 15px;
    justify-content: space-between;
    .left {
      display: flex;
      width: 80px;
      justify-content: space-between;
      font-size: 14px;
      color: #ccc;
      a {
        text-decoration: none;
        color: #ccc;
      }
      .e-ac {
        color: #000;
      }
      .item {
        height: 30px;
        line-height: 28px;
        display: flex;
        flex-direction: column;
        align-items: center;
        .hx {
          width: 50%;
          height: 2px;
          background-color: #000;
        }
        .hx {
          animation-duration: 1s;
          animation-name: slidein;
        }

        @keyframes slidein {
          from {
            width: 100%;
          }

          to {
            width: 50%;
          }
        }
      }
    }
    .right {
      width: 80px;
      height: 30px;
      background-image: url("../assets/mj.png");
      background-size: 100% 100%;
    }
  }
}
</style>
